A=[-25 -9 -27 0 0; 536 185 537 1 0; 154 52 143 0 1];
A(1,:)=A(1,:)/A(1,1);
A(2,:)=A(2,:)-A(2,1)/A(1,1)*A(1,:);
A(3,:)=A(3,:)-A(3,1)/A(1,1)*A(1,:);
A(2,:)=A(2,:)/A(2,2);
A(1,:)=A(1,:)-A(1,2)/A(2,2)*A(2,:);
A(3,:)=A(3,:)-A(3,2)/A(2,2)*A(2,:);
A(3,:)=A(3,:)/A(3,3);
A(1,:)=A(1,:)-A(1,3)/A(3,3)*A(3,:);
A(2,:)=A(2,:)-A(2,3)/A(3,3)*A(3,:);
A